package com.yonyou.cyxdms.sysAuth.service.mapper;

import com.yonyou.cyx.framework.dao.base.SuperMapper;
import com.yonyou.cyxdms.sysAuth.service.entity.PermissionMenuRangePO;
import com.yonyou.cyxdms.sysAuth.service.vo.employee.UserPermissionRangeVO;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

/**
 * <p>
 * 菜单数据范围权限表 Mapper 接口
 * </p>
 *
 * @author quankk
 * @since 2019-07-05
 */
public interface PermissionMenuRangeMapper extends SuperMapper<PermissionMenuRangePO> {

    /**
     * @description：菜单控制权限
     * @author     ：maxingjian
     * @date       ：Created in 2019/7/10
     * @modified By：
     */
    List<Map> findMenuRange(@Param("permissionType")Integer permissionType, @Param("params") Map<String, Object> params);

    void updatePermissionMenuRange(@Param("isEmpowered")Integer isEmpowered, @Param("permissionMenuId")Integer permissionMenuId);

    void modifyPermissionMenuRange(@Param("isEmpowered")Integer isEmpowered, @Param("permissionMenuId")Long permissionMenuId, @Param("menuRangeId")Integer menuRangeId);

    void modifyPermissionMenuRange2(@Param("param") Map<String, Object> param);

    List<Map<String,Object>> findAllListmapOne(@Param("permissionIDs")List<String> permissionids, @Param("permissionType")Integer permissionType, @Param("isEmpowered")Integer isEmpowered);

    List<Map<String,Object>> findAllListmapTwo(@Param("permissionIDs")List<String> permissionids, @Param("permissionType")Integer permissionType, @Param("isEmpowered")Integer isEmpowered);

    List<Map<String,Object>> findAllListmapThree(@Param("permissionIDs")List<String> permissionids, @Param("permissionType")Integer permissionType, @Param("isEmpowered")Integer isEmpowered);

    void deletePMR(@Param("permissionMenuIds") List<Long> permissionMenuIds);

    List<UserPermissionRangeVO> selectPermissionMenuIds(@Param("roleIds") List<Long> roleIds);

    void deleteUserRange(@Param("userOrgId") Long userOrgId);

    void insertRange(@Param("permissionMenuId") Long permissionMenuId, @Param("checkid") String[] checkid, @Param("userId") Long userId);

    Integer findRangeBymenuId(@Param("permissionType") Integer permissionType, @Param("permissionId") Long permissionId, @Param("appId") String appId, @Param("menuId") Long menuId);

    void insertRangeByOthers(@Param("otherPermissionIds") List<Long> otherPermissionIds, @Param("otherPermissionType") Integer otherPermissionType, @Param("permissionId") Long permissionId, @Param("permissionType") Integer permissionType, @Param("createBy") String createBy);

    void deleteRangeByRoleId(@Param("roleId") Long roleId);
}
